package com.fjwt.gz.mch.ctrl.proxy;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.fjwt.gz.core.model.ApiRes;
import com.fjwt.gz.db.vo.ScoreRecordTotalVO;
import com.fjwt.gz.mch.ctrl.CommonCtrl;
import com.fjwt.gz.service.impl.ScoreRecordTotalService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/api/proxy/fansScoreTotal")
public class FansScoreTotalProxyController extends CommonCtrl {

    @Autowired
    private ScoreRecordTotalService scoreRecordTotalService;

    /**
     * 查询用户积分
     */
    @PostMapping("/getFansScoreRecord")
    public ApiRes getFansScoreRecord(){
        String phone = getValString("phone");
        String nickName = getValString("nickName");
        String sTime = getValString("sTime");
        String eTime = getValString("eTime");
        log.info("查询用户积分接口调用：请求地址：/api/fansScoreTotal/getFansScoreRecord，手机号：{}，用户名称：{}，开始时间：{}，结束时间：{}",phone,nickName,sTime,eTime);
        IPage<ScoreRecordTotalVO> list = scoreRecordTotalService.getFansScoreRecord(getIPage(), phone, nickName,sTime,eTime);
        return ApiRes.page(list);
    }
}
